<?php
header('Location:http://www.mangse.com/');

get_header(); ?>
<div id="content" class="content">
	<div id="innerContent">
		<div class="textbox">
				<div class="textbox_header"></div>
			<div class="textbox_inner">
	                <div class="textbox-title">
	                    <?php $post = $posts[0]; ?>
					 	  <?php 
					 	  	if (is_category()) {
					 	  		$cat = intval( get_query_var('cat') );
					 	  ?>
							<h1 class="pagetitle">
							栏目 | <?php echo single_cat_title('', false); ?>
							</h1>
							<?php if($parent_cate = walleve_get_category_parents($cat,true,"<li>","</li>")): ?>
							<h2 class="post_info"> 
								  <div class="page_info_left">
									<ul>
									
									<?php
									echo $parent_cate;
									?>
									<?php
									if(get_category_children($cat)):
										wp_list_categories('title_li=&hide_empty=0&depth=1&child_of='.$cat);
									endif;
									?>
									</ul>
								  </div>
							</h2>
							<?php endif; ?>
					 	  <?php } elseif( is_tag() ) { ?>
							<h2 class="pagetitle">
							标签 | <?php echo single_tag_title('', false); ?>
							</h2>
					 	  <?php } elseif (is_day()) { ?>
							<h2 class="pagetitle">
							存档 |　<?php echo get_the_time(__('F jS, Y', 'kubrick')) ?>
							</h2>
					 	  <?php } elseif (is_month()) { ?>
							<h2 class="pagetitle">
							存档 | <?php echo get_the_time(__('F, Y', 'kubrick')); ?>
							</h2>
					 	  <?php } elseif (is_year()) { ?>
							<h2 class="pagetitle">
							存档 | <?php echo get_the_time(__('Y', 'kubrick')); ?></h2>
						  <?php } elseif (is_author()) { ?>
							<h2 class="pagetitle"><?php _e('Author Archive', 'kubrick'); ?></h2>
					 	  <?php } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
							<h2 class="pagetitle"><?php _e('Blog Archives', 'kubrick'); ?></h2>
					 	  <?php } ?>
	                </div>
					</div>
				<div class="textbox_footer"></div>
			</div>
			<?php if (have_posts()) : ?>
			<div class="textbox">
					<div class="textbox_header"></div>
				<div class="textbox_inner">
		                <div class="textbox-title">

			<?php while (have_posts()) : the_post(); ?>
							<h1 class="postlist" id="post-<?php the_ID(); ?>">
										<span>
										<?php comments_popup_link(__('看法', 'kubrick'), __('1个看法', 'kubrick'), __('%个看法', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?>
										<?php the_time(__('F jS, Y', 'kubrick')) ?>
									</span>
									<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a>
									</h1>
				<?php endwhile; ?>
				 </div>
					</div>
					<div class="textbox_footer"></div>
				</div>
				<div class="article-bottom" style="display: block">
					<div class="pages">
						<!--分页-->
							<span class="pagebar-selections">
							<div id="pagenavi">
								<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
							</div>
							</span>
					</div>
				</div>
				<?php else: ?>
				
				<div class="textbox">
					<div class="textbox_header"></div>
				<div class="textbox_inner">
				<?php 
				if ( is_category() ) { // If this is a category archive
					printf("<h2 class='center'>".__("Sorry, but there aren't any posts in the %s category yet.", 'kubrick').'</h2>', single_cat_title('',false));
				} else if ( is_date() ) { // If this is a date archive
					echo('<h2>'.__("Sorry, but there aren't any posts with this date.", 'kubrick').'</h2>');
				} else if ( is_author() ) { // If this is a category archive
					$userdata = get_userdatabylogin(get_query_var('author_name'));
					printf("<h2 class='center'>".__("Sorry, but there aren't any posts by %s yet.", 'kubrick')."</h2>", $userdata->display_name);
				} else {
					echo("<h2 class='center'>".__('No posts found.', 'kubrick').'</h2>');
				}
			  	get_search_form();
				?>
				</div>
					<div class="textbox_footer"></div>
				</div>
								
			<?php endif; ?>
			
	</div>
</div>

<?php get_sidebar(); ?>
<?php get_footer(); ?>